home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4227 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  55 lines

  1. Path: news.compuserve.com!newsmaster
  2. From: <artb@uc.mhs.compuserve.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Serial Communications in C
  5. Date: 2 Feb 1996 19:20:09 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4eto59$ht7@dub-news-svc-3.compuserve.com>
  8. NNTP-Posting-Host: dd62-151.compuserve.com
  9. Content-Type: text/plain
  10. Keywords: Serial Communications C
  11. Content-length: 1324
  12. X-Newsreader: AIR Mosaic (16-bit) version 3.10.08.25
  13.  
  14.  
  15.  David, 
  16.  
  17. I use MSVC 1.2 with serial communications. The following function is available there:
  18.  
  19. _bios_serialcom 
  20.  
  21. #include <bios.h>
  22.  
  23. Syntax     unsigned _bios_serialcom( unsigned service, unsigned serial_port, unsigned data );
  24.  
  25. Parameter    Description
  26. service        Communications service
  27. serial_port     Serial port to use
  28. data    Port configuration bits
  29. The _bios_serialcom routine uses INT 0x14 to provide serial communications services. The serial_port parameter is set to 0 for 
  30. COM1, to 1 for COM2, and so on.
  31. The _bios_serialcom routine may not be able to establish reliable communications at baud rates in excess of 1,200 baud 
  32. (_COM_1200) due to the overhead associated with servicing computer interrupts. Faster data communication rates are possible 
  33. with more direct programming of serial-port controllers. See C Programmer's Guide to Serial Communications for more details on 
  34. serial-communications programming in C.
  35.  
  36. The service parameter can be set to one of the following manifest constants:
  37.  
  38. _COM_INIT
  39.  
  40. Sets the port to the parameters specified in the data parameter
  41.  
  42. _COM_SEND
  43.  
  44. Transmits the data characters over the selected serial port
  45.  
  46. _COM_RECEIVE
  47.  
  48. Accepts an input character from the selected serial port
  49.  
  50. _COM_STATUS
  51.  
  52. Returns the current status of the selected serial port
  53.  
  54.  
  55.